<?php
$maint_log_subhead = $maint_log_title = "Add a Project";
require_once("include_functions.php");
require_once("include_header.php");
?>
<div id="content">
	<div class="form-box">
		<form action="manage_projects.php" method="post">
			<div>
				<label for="projName">Project Name:</label>
				<input type="text" name="projName" id="projName" />
			</div>
			<div>
				<label for="workerAssignedId">Assigned To:</label>
				<select name="workerAssignedId" id="workerAssignedId">
			<?php
				// Gather full list of workers for select box
				$sql =	"SELECT workerId, workerName ". 
						"FROM workers";
				if(!$result = mysql_query($sql)) echo mysql_error();
				while($worker = mysql_fetch_array($result)) {
				echo "<option value=\"$worker[workerId]\">$worker[workerName]</option>";
				}
			?>
				</select>
			</div>
			<div>
				<label for="projCreator">Created By:</label>
				<input type="text" name="projCreator" id="projCreator" />
			</div>
			<div>
				<label for="projCreatorEmail">Creator Email:</label>
				<input type="text" name="projCreatorEmail" id="projCreatorEmail" />
			</div>
			<div>
				<label for="requestedDate">Requested Complete By:</label>
	<!-- Start Date Picker script -->
				<input name='projRequestedDate' type='text' value='<?php echo date("Y-m-d");?>' id='requestedDate' />
				<script type="text/javascript">
					window.addEvent('load', function() {
						new DatePicker('#requestedDate', {
							inputOutputFormat: 'Y-m-d',
							format: 'm-d-Y',
							yearPicker: false
						});
					});
				</script>

	<!-- End Date Picker script -->
			</div>
			<div>
				<label for="projPriority">Priority:</label>
				<select name="projPriority" id="projPriority" />
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
				</select>
			</div>
			<div>
				<label for="projDescription">Description:</label>
				<textarea rows="10" cols="50" name="projDescription" id="projDescription" ></textarea>
			</div>
			<div class="buttons">
				<input type="hidden" name="action" value="create">
				<input type="submit" name="submit" value="submit">
				<input type="reset" value="reset">
			</div>
		</form>
	</div>
</div>
<?php
require_once("include_footer.php");
?>
